package club.jdiy.core.convert;

abstract class NumberConverter<T extends Number> extends Converter {
    final T source;

    public NumberConverter(T source) {
        this.source = source;
    }

    public T getSource() {
        return source;
    }

    @Override
    public Byte getByte() {
        return source.byteValue();
    }

    @Override
    public Short getShort() {
        return source.shortValue();
    }

    @Override
    public Integer getInteger() {
        return source.intValue();
    }

    @Override
    public Long getLong() {
        return source.longValue();
    }

    @Override
    public Float getFloat() {
        return source.floatValue();
    }

    @Override
    public Double getDouble() {
        return source.doubleValue();
    }
}
